//路由配置
import { createBrowserRouter as cbr } from "react-router-dom";
import Layout from "@/pages/Layout";
import Login from "@/pages/Login";
import Publish from '@/pages/Publish';
import Article from '@/pages/Article';
import Home from '@/pages/Home';
import {AuthRoute} from "@/components/AuthRoute";


const router = cbr([
    {
        path: "/",
        element:<AuthRoute><Layout /></AuthRoute>, 
        children: [
            {
                index: true,
                element: <Home />,
            },
            {
                path: 'article',
                element: <Article />,
            },
            {
                path: 'publish',
                element: <Publish />,
            },
        ],
    },
    {
        path: "login",
        element: <Login />
    }
])

export default router